import request from '../../util/axios'
import { serialize } from '../../util/util'

// 查询纸质档案借阅列表
export const getBorrowList = (data) => {
  return request({
    url: '/yuyi-storehouse-boot/text/demo1/paging',
    method: 'post',
    data: data
  })
}
// 借阅记录下载
export const borrowtDownload = () => {
  return request({
    url: '/yuyi-storehouse-boot/text/demo1/exportuser',
    method: 'post',
    responseType: 'blob'
  })
}

// 借阅记录 -- 新增
export const addBorrowt = (data) => {
  return request({
    url: '/yuyi-storehouse-boot/text/demo1/add',
    method: 'post',
    data: data
  })
}
// 借阅记录删除
export const detBorrowt = (data) => {
  return request({
    url: '/yuyi-storehouse-boot/text/demo1/delete',
    method: 'delete',
    data: data
  })
}
// 归还判断
export const revertRequest = (query) => {
  return request({
    url: '/yuyi-storehouse-boot/text/demo1/judge' + serialize(query),
    method: 'post'
  })
}
// 借阅记录 -- 获取单条信息
export const getSingleData = (query) => {
  return request({
    url: '/yuyi-storehouse-boot/text/demo1/sysPaperArchivesBorrowing' + serialize(query),
    method: 'post'
  })
}
// 修改借阅
export const editBorrowt = (data) => {
  return request({
    url: '/yuyi-storehouse-boot/text/demo1/edit',
    method: 'put',
    data: data
  })
}
// 修改 -- 删除列表单条数据
export const editListDel = (query) => {
  return request({
    url: '/yuyi-storehouse-boot/text/demo1/partialDeletes' + serialize(query),
    method: 'post'
  })
}
// 修改 -- 新增操作单条数据
export const editListAdd = (data) => {
  return request({
    url: '/yuyi-storehouse-boot/text/demo1/partialAdds',
    method: 'post',
    data: data
  })
}
